package com.lk.ii.service.impl;

import java.util.List;
import com.lk.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lk.ii.mapper.IiAdMaterialMapper;
import com.lk.ii.domain.IiAdMaterial;
import com.lk.ii.service.IIiAdMaterialService;
import com.lk.common.core.text.Convert;

/**
 * 广告位详情Service业务层处理
 * 
 * @author lk
 * @date 2021-02-05
 */
@Service
public class IiAdMaterialServiceImpl implements IIiAdMaterialService 
{
    @Autowired
    private IiAdMaterialMapper iiAdMaterialMapper;

    @Override
    public List<IiAdMaterial> getIiAdMaterialList(Long adId)
    {
        return iiAdMaterialMapper.getIiAdMaterialList(adId);
    }

    /**
     * 查询广告位详情
     * 
     * @param id 广告位详情ID
     * @return 广告位详情
     */
    @Override
    public IiAdMaterial selectIiAdMaterialById(Long id)
    {
        return iiAdMaterialMapper.selectIiAdMaterialById(id);
    }

    /**
     * 查询广告位详情列表
     * 
     * @param iiAdMaterial 广告位详情
     * @return 广告位详情
     */
    @Override
    public List<IiAdMaterial> selectIiAdMaterialList(IiAdMaterial iiAdMaterial)
    {
        return iiAdMaterialMapper.selectIiAdMaterialList(iiAdMaterial);
    }

    /**
     * 新增广告位详情
     * 
     * @param iiAdMaterial 广告位详情
     * @return 结果
     */
    @Override
    public int insertIiAdMaterial(IiAdMaterial iiAdMaterial)
    {
        iiAdMaterial.setCreateTime(DateUtils.getNowDate());
        return iiAdMaterialMapper.insertIiAdMaterial(iiAdMaterial);
    }

    /**
     * 修改广告位详情
     * 
     * @param iiAdMaterial 广告位详情
     * @return 结果
     */
    @Override
    public int updateIiAdMaterial(IiAdMaterial iiAdMaterial)
    {
        iiAdMaterial.setUpdateTime(DateUtils.getNowDate());
        return iiAdMaterialMapper.updateIiAdMaterial(iiAdMaterial);
    }

    /**
     * 删除广告位详情对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteIiAdMaterialByIds(String ids)
    {
        return iiAdMaterialMapper.deleteIiAdMaterialByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除广告位详情信息
     * 
     * @param id 广告位详情ID
     * @return 结果
     */
    @Override
    public int deleteIiAdMaterialById(Long id)
    {
        return iiAdMaterialMapper.deleteIiAdMaterialById(id);
    }
}
